<include file="../header" />
</head>
<body class="J_scroll_fixed">
<script type="text/javascript">
    $(function() {
//        $("#process"+"{$page}").attr("class", "img-process-select");

        $("input[name=completed]").click(function() {
            if($("input[name=completed]").is(':checked')) {
                $("button.btn_submit").text("完成");
            }else{
                $("button.btn_submit").text("更新");
            }
        });

        $("button.btn_submit").click(function() {
            if($("input[name=completed]").is(':checked')) {
                if($("input[name=audit_date]").val() == ""){
                    alert("请填写【收检日期】");
                    $("input[name=audit_date]").focus();
                    return false;
                }
                if($("input[name=report_date]").val() == ""){
                    alert("请填写【报告日期】");
                    $("input[name=report_date]").focus();
                    return false;
                }

                if (confirm("勾选'完成'后提交表单将无法再次修改，是否继续提交")) {
                    $("button.btn_submit").hide();
                } else {
                    return false;
                }
            }else{
                $("button.btn_submit").hide();
            }
        });

        if(parseInt('{$workorder.audit_status}') == 1){
            $("button.btn_submit").attr("disabled","disabled");
        }
    });

</script>
<style type="text/css">
    .img-process{
        width: 70px;
        height: 70px;
        /*cursor: pointer;*/
    }
    .img-process-select{
        width: 70px;
        height: 70px;
        cursor: pointer;
        border: solid;
        border-color: #1ABC9B;
    }
</style>
<form class="well form-search"  style="float:left;width:100%;margin-bottom: -20px" >
    <php>$imgVersion = "2020051401";</php>
    <div class="search_type cc mb10">
        <div >
            <span class="mr20">
                工单号：<input type="text" value="{$workorder.workorder_no}" readonly/>&nbsp;
                患者：<input type="text" value="{$patient.patient_name}，{$patient.sex}，{$patient.age}岁 {$workorder.side}" readonly/>&nbsp;
                业务员：<input type="text" style="width: 110px" value="{$sales.admin_name}" readonly/>&nbsp;
                处方人：<input type="text" style="width: 110px" value="{$prescriber.admin_name}" readonly/>
            </span>
        </div>
        <br/>
        <php>
            $processStatusArr=explode(",",$workorder["process_status"]);
            if(in_array($workorder["workorder_type"],array('1','5','6','7')))
            $processArr = array("取阴模", "检查取阴模","修阳模","检查修阳模","热塑成型","检查热塑成型","打磨抛光","检查打磨抛光","组装对线","半成品适配","穿戴及使用训练","入库");
            if(in_array($workorder["workorder_type"],array('2','4')))
            $processArr = array("取阴模2", "检查取阴模2","修阳模2","检查修阳模2","热塑成型","检查热塑成型","打磨抛光","检查打磨抛光","组装对线","半成品适配2","穿戴及使用训练2","入库");
            for($i = 0; $i < 12; $i++){
            if($processStatusArr[$i] == "1"){
            $processArr[$i] .= "亮";
            }
            }
        </php>
        <td>
            工序：
            <if condition="$orthosisProcess[0] eq '1'">
                <img class="img-process" id="process1" src="/Template/images/{$processArr.0}.png?v={$imgVersion}" title="取阴模"/>
            </if>
            <if condition="$orthosisProcess[1] eq '1'">
                <img class="img-process" id="process2" src="/Template/images/{$processArr.1}.png?v={$imgVersion}" title="检查取阴模"/>
            </if>
            <if condition="$orthosisProcess[2] eq '1'">
                <img class="img-process" id="process3" src="/Template/images/{$processArr.2}.png?v={$imgVersion}" title="修阳模"/>
            </if>
            <if condition="$orthosisProcess[3] eq '1'">
                <img class="img-process" id="process4" src="/Template/images/{$processArr.3}.png?v={$imgVersion}" title="检查修阳模"/>
            </if>
            <if condition="$orthosisProcess[4] eq '1'">
                <img class="img-process" id="process5" src="/Template/images/{$processArr.4}.png?v={$imgVersion}" title="热塑成型"/>
            </if>
            <if condition="$orthosisProcess[5] eq '1'">
                <img class="img-process" id="process6" src="/Template/images/{$processArr.5}.png?v={$imgVersion}" title="检查热塑成型"/>
            </if>
            <if condition="$orthosisProcess[6] eq '1'">
                <img class="img-process" id="process7" src="/Template/images/{$processArr.6}.png?v={$imgVersion}" title="打磨抛光"/>
            </if>
            <if condition="$orthosisProcess[7] eq '1'">
                <img class="img-process" id="process8" src="/Template/images/{$processArr.7}.png?v={$imgVersion}" title="检查打磨抛光"/>
            </if>
            <if condition="$orthosisProcess[8] eq '1'">
                <img class="img-process" id="process9" src="/Template/images/{$processArr.8}.png?v={$imgVersion}" title="组装对线"/>
            </if>
            <if condition="$orthosisProcess[9] eq '1'">
                <img class="img-process" id="process10" src="/Template/images/{$processArr.9}.png?v={$imgVersion}" title="半成品适配"/>
            </if>
            <if condition="$orthosisProcess[10] eq '1'">
                <img class="img-process" id="process11" src="/Template/images/{$processArr.10}.png?v={$imgVersion}" title="穿戴及使用训练"/>
            </if>
            <if condition="$orthosisProcess[11] eq '1'">
                <img class="img-process" id="process12" src="/Template/images/{$processArr.11}.png?v={$imgVersion}" title="入库"/>
            </if>
        </td>
    </div>
</form>
<div class="wrap jj">
    <div class="common-form">
        <form method="post" class="form-horizontal J_ajaxForm" action="{:U('Workorder/audit_post')}" onkeydown="if(event.keyCode==13)return false;">
            <input type="hidden" name="id" value="{$workorder.workorder_id}" />
            <fieldset>
                <hr class="half-rule">
                <div>
                    <a style="font-size: large;font-weight: bold">成品检验报告单</a>
                    <br/><br/>
                    批号：<input type="text" value="{$audit.batch_no}" readonly/>&nbsp;&nbsp;
                    检验单号：<input type="text" value="{$audit.audit_no}" readonly/>&nbsp;&nbsp;
                    <br/><br/>
                    品名：<input type="text" name="batch_name" value="{$audit.batch_name}"/>&nbsp;&nbsp;
                    型号：
                    <select style="width: 180px" name="customized_product_id">
                        {:getCommonSelectOptionHtml($workorder['customized_product_id'], "CustomizedProduct", "customized_product_id", "customized_product_code", null, 1, 1)}
                    </select>&nbsp;&nbsp;
                    批量：<input style="width: 70px" type="text" name="mount" value="{$audit.mount}"/>&nbsp;&nbsp;
                    <br/><br/>
                    结论：<textarea style="height:40px; width: 590px;" name="conclusion"><?php echo ($audit["conclusion"]); ?></textarea>
                    <br/><br/>
                    收检日期：<input type="text" style="width: 130px" class="J_date" name="audit_date" value="{$audit.audit_date}">&nbsp;&nbsp;
                    报告日期：<input type="text" style="width: 130px" class="J_date" name="report_date" value="{$audit.report_date}">&nbsp;&nbsp;
                </div>

                <hr class="half-rule">
                <a style="font-size: large;font-weight: bold">成品检验记录</a>
                <br/><br/>
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th style="font-weight:bold;text-align: center;width: 15px">序号</th>
                        <th style="font-weight:bold;text-align: center;width: 100px">检测项目</th>
                        <th style="font-weight:bold;text-align: center;width: 130px">是否适用（不适用代表不包括此配件）</th>
                        <th style="font-weight:bold;text-align: center;width: auto">标准要求</th>
                        <th style="font-weight:bold;text-align: center;width: 70px">实测值</th>
                        <th style="font-weight:bold;text-align: center;width: 70px">理论公差</th>
                        <th style="font-weight:bold;text-align: center;width: 70px">实际公差</th>
                        <th style="font-weight:bold;text-align: center;width: 70px">检验工具</th>
                        <th style="font-weight:bold;text-align: center;width: 200px">结论</th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td style="text-align: center;">1</td>
                            <td style="text-align: center;">外观</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r0">
                                    <option value="{$audit.r0}">请选择</option>
                                    {:getFormDictSelectOption($audit['r0'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;">所有缝制连接处缝制牢固，针迹均匀，无明显疵点；支条所有铆接处均应牢固，铆接头应光滑，支条宽窄一致，无棱角，表面均匀处理；塑性材料制品均应色泽均匀，无划痕和裂纹；上/下肢医用外固定支具整体光滑、平整、边缘不得有毛刺和尖角。</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r1" value="{$audit.r1}"></td>
                            <td style="text-align: center;">一致</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r2" value="{$audit.r2}"></td>
                            <td style="text-align: center;">目测</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r3" value="{$audit.r3}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">2</td>
                            <td style="text-align: center;">支条宽</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r4">
                                    <option value="{$audit.r4}">请选择</option>
                                    {:getFormDictSelectOption($audit['r4'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r5" value="{$audit.r5}"></td>
                            <td style="text-align: center;">±0.05cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r6" value="{$audit.r6}"></td>
                            <td style="text-align: center;">直尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r7" value="{$audit.r7}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">3</td>
                            <td style="text-align: center;">足托宽</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r8">
                                    <option value="{$audit.r8}">请选择</option>
                                    {:getFormDictSelectOption($audit['r8'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r9" value="{$audit.r9}"></td>
                            <td style="text-align: center;">±0.5cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r10" value="{$audit.r10}"></td>
                            <td style="text-align: center;">卡尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r11" value="{$audit.r11}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">4</td>
                            <td style="text-align: center;">支条长</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r12">
                                    <option value="{$audit.r12}">请选择</option>
                                    {:getFormDictSelectOption($audit['r12'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r13" value="{$audit.r13}"></td>
                            <td style="text-align: center;">±0.2cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r14" value="{$audit.r14}"></td>
                            <td style="text-align: center;">直尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r15" value="{$audit.r15}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">5</td>
                            <td style="text-align: center;">铰链长</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r16">
                                    <option value="{$audit.r16}">请选择</option>
                                    {:getFormDictSelectOption($audit['r16'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r17" value="{$audit.r17}"></td>
                            <td style="text-align: center;">±0.2cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r18" value="{$audit.r18}"></td>
                            <td style="text-align: center;">卡尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r19" value="{$audit.r19}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">6</td>
                            <td style="text-align: center;">铰链宽</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r20">
                                    <option value="{$audit.r20}">请选择</option>
                                    {:getFormDictSelectOption($audit['r20'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r21" value="{$audit.r21}"></td>
                            <td style="text-align: center;">±0.05cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r22" value="{$audit.r22}"></td>
                            <td style="text-align: center;">卡尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r23" value="{$audit.r23}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">7</td>
                            <td style="text-align: center;">足托长</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r24">
                                    <option value="{$audit.r24}">请选择</option>
                                    {:getFormDictSelectOption($audit['r24'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r25" value="{$audit.r25}"></td>
                            <td style="text-align: center;">±0.5cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r26" value="{$audit.r26}"></td>
                            <td style="text-align: center;">直尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r27" value="{$audit.r27}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">8</td>
                            <td style="text-align: center;">腿箍长</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r28">
                                    <option value="{$audit.r28}">请选择</option>
                                    {:getFormDictSelectOption($audit['r28'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r29" value="{$audit.r29}"></td>
                            <td style="text-align: center;">±0.2cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r30" value="{$audit.r30}"></td>
                            <td style="text-align: center;">皮尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r31" value="{$audit.r31}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">9</td>
                            <td style="text-align: center;">腿箍宽</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r32">
                                    <option value="{$audit.r32}">请选择</option>
                                    {:getFormDictSelectOption($audit['r32'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r33" value="{$audit.r33}"></td>
                            <td style="text-align: center;">±0.05cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r34" value="{$audit.r34}"></td>
                            <td style="text-align: center;">皮尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r35" value="{$audit.r35}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">10</td>
                            <td style="text-align: center;">上/下肢医用外固定支具长</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r36">
                                    <option value="{$audit.r36}">请选择</option>
                                    {:getFormDictSelectOption($audit['r36'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r37" value="{$audit.r37}"></td>
                            <td style="text-align: center;">±0.5cm</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r38" value="{$audit.r38}"></td>
                            <td style="text-align: center;">皮尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r39" value="{$audit.r39}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">11</td>
                            <td style="text-align: center;">角度</td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r40">
                                    <option value="{$audit.r40}">请选择</option>
                                    {:getFormDictSelectOption($audit['r40'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r41" value="{$audit.r41}"></td>
                            <td style="text-align: center;">±1°</td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r42" value="{$audit.r42}"></td>
                            <td style="text-align: center;">角度尺</td>
                            <td><input type="text" class="input" style="text-align: center;" name="r43" value="{$audit.r43}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">12</td>
                            <td><input type="text" class="input" style="text-align: center;width: 85px" name="r44" value="{$audit.r44}"></td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r45">
                                    <option value="{$audit.r45}">请选择</option>
                                    {:getFormDictSelectOption($audit['r45'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r46" value="{$audit.r46}"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r47" value="{$audit.r47}"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r48" value="{$audit.r48}"></td>
                            <td><input type="text" class="input" style="text-align: center;" name="r49" value="{$audit.r49}"></td>
                            <td><input type="text" class="input" style="text-align: center;" name="r50" value="{$audit.r50}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">13</td>
                            <td><input type="text" class="input" style="text-align: center;width: 85px" name="r51" value="{$audit.r51}"></td>
                            <td style="text-align: center;">
                                <select style="text-align: center;width: 85px" name="r52">
                                    <option value="{$audit.r52}">请选择</option>
                                    {:getFormDictSelectOption($audit['r52'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r53" value="{$audit.r53}"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r54" value="{$audit.r54}"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r55" value="{$audit.r55}"></td>
                            <td><input type="text" class="input" style="text-align: center;" name="r56" value="{$audit.r56}"></td>
                            <td><input type="text" class="input" style="text-align: center;" name="r57" value="{$audit.r57}"></td>
                        </tr>
                        <tr>
                            <td style="text-align: center;">14</td>
                            <td><input type="text" class="input" style="text-align: center;width: 85px" name="r58" value="{$audit.r58}"></td>
                            <td style="text-align: center;">
                                <select style="width: 85px" name="r59">
                                    <option value="{$audit.r59}">请选择</option>
                                    {:getFormDictSelectOption($audit['r59'],'yesorno','all',0)}
                                </select>
                            </td>
                            <td style="text-align: center;"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r60" value="{$audit.r60}"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r61" value="{$audit.r61}"></td>
                            <td><input type="text" class="input" style="text-align: center;width: 60px" name="r62" value="{$audit.r62}"></td>
                            <td><input type="text" class="input" style="text-align: center;" name="r63" value="{$audit.r63}"></td>
                            <td><input type="text" class="input" style="text-align: center;" name="r64" value="{$audit.r64}"></td>
                        </tr>

                    </tbody>
                </table>

                <div class="control-group">
                    <label class="control-label">填写人:</label>
                    <div class="controls">
                        <img style="height: 50px" src="{$user.signimgurl}">
                    </div>
                </div>
                
                <hr class="half-rule">
                <div class="control-group">
                    <div class="controls">
                        <label class="checkbox inline" style="font-weight: bold">
                            <input type="checkbox"  name="completed">完成（勾选后提交表单将无法再次修改）
                        </label>
                    </div>
                </div>

            </fieldset>
            <div class="form-actions">
                <button type="submit" class="btn btn-primary btn_submit ">更新</button>
                <if condition="$adminUpdate eq 'true'">
                    <button type="submit" class="btn btn-danger">管理员更新</button>
                </if>
                <a class="btn" href="__URL__">返回</a>
            </div>
        </form>
    </div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>